-- -*- haskell -*-
-- Colorizing GHCi prompt

-- generated with 
--   echo -e :set prompt '"\033[32;1m%s\033[34;1m>\033[0m "' > ~/.ghc/ghci.conf
-- see
--   http://en.wikipedia.org/wiki/ANSI_escape_code--Colors
-- for color info, and
-- - http://martijn.van.steenbergen.nl/journal/2010/02/27/colors-in-ghci/
-- - http://www.haskell.org/haskellwiki/GHCi_in_colour
-- for ways to color other parts of ghci output (but not the prompt :P)
--
-- the color escapes screw up GHCi's idea of where the prompt ends.
-- this is the "non-printable character" problem in bash and zsh,
-- which is solved there by \[...\] and %{...%}, respectively.
-- Neither of those work in GHCi, but simply putting the prompt on a
-- different line than the colors works.
--
-- however, emacs's haskellm-mode is still confused by the two line
-- prompt, but disabling the custom prompt with
--
--   (setq haskell-program-name "ghci -ignore-dot-ghci")
--
-- works.  But then we don't get any of the other .ghci settings.  So,
-- instead, we factor out the prompt here, and load it only when running
-- a custom ghci with `nc:ghci`.

:set prompt "[32;1m%s[0m\n> "
